// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import 'babel-polyfill'
import Vue from 'vue'
import './style/theme/index.css'
import './assets/icon/iconfont.css'
import App from './App'
import router from './router/index'
import store from './store/index'
import VueLazyload from 'vue-lazyload'
import VueClipboard from 'vue-clipboards'
import {Message, Loading, MessageBox} from 'element-ui'
import * as filters from './config/filters'
import * as directives from './config/derectives'

Vue.prototype.$msgbox = MessageBox
Vue.prototype.$message = Message
Vue.prototype.$confirm = MessageBox.confirm
Vue.prototype.$loading = Loading.service
Vue.prototype.$alert = MessageBox.alert

Vue.use(VueLazyload, {
  preLoad: 1.3,
  error: '../static/newload.png',
  loading: '../static/loading.gif',
  observer: true
})

Vue.use(VueClipboard)

Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})

Vue.use(directives)

Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
  el: '#app',
  store,
  router,
  template: '<App/>',
  components: { App }
})
